package com.cykj.eurekaribbon.service.impl;

import com.cykj.eurekaribbon.bean.RouteInfo;
import com.cykj.eurekaribbon.service.RouteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.loadbalancer.LoadBalancerClient;
import org.springframework.stereotype.Service;

import org.springframework.web.client.RestTemplate;



@Service
public class RouteServiceImpl implements RouteService {
    @Autowired
    LoadBalancerClient loadBalancer;

    @Autowired
    RestTemplate restTemplate;

    /**
     * @version 1.0
     * @author: zhiMing
     * @date: 2021/9/22 9:00
     * @desc: 根据路线信息获取该路线的发车时刻集合
     */
    @Override
    public RouteInfo getTimeNodeList(String routeName){
        return restTemplate.getForObject("http://CLIENT/getTimeNodeList?routeName="+routeName,RouteInfo.class);
    }
}
